package com.example.meituan.activity.bean;

import android.database.Cursor;

import java.io.Serializable;
import java.util.ArrayList;

public class UserAddressBean implements Serializable {


    private String s_id;
    private String s_user_id;
    private String s_name;
    private String s_phone;
    private String s_address;

    // 构造函数
    public UserAddressBean(String s_id, String s_user_id, String s_name, String s_phone, String s_address) {
        this.s_id = s_id;
        this.s_user_id = s_user_id;
        this.s_name = s_name;
        this.s_phone = s_phone;
        this.s_address = s_address;
    }

    public UserAddressBean() {

    }

    // Getters and Setters

    public String getS_id() {
        return s_id;
    }

    public void setS_id(String s_id) {
        this.s_id = s_id;
    }

    public String getS_user_id() {
        return s_user_id;
    }

    public void setS_user_id(String s_user_id) {
        this.s_user_id = s_user_id;
    }

    public String getS_name() {
        return s_name;
    }

    public void setS_name(String s_name) {
        this.s_name = s_name;
    }

    public String getS_phone() {
        return s_phone;
    }

    public void setS_phone(String s_phone) {
        this.s_phone = s_phone;
    }

    public String getS_address() {
        return s_address;
    }

    public void setS_address(String s_address) {
        this.s_address = s_address;
    }

    public static UserAddressBean fromCursor(Cursor cursor) {
        if (cursor == null || cursor.getCount() == 0) return null;

        UserAddressBean address = new UserAddressBean();
        address.setS_id(cursor.getString(cursor.getColumnIndexOrThrow("s_id")));
        address.setS_user_id(cursor.getString(cursor.getColumnIndexOrThrow("s_user_id")));
        address.setS_name(cursor.getString(cursor.getColumnIndexOrThrow("s_name")));
        address.setS_phone(cursor.getString(cursor.getColumnIndexOrThrow("s_phone")));
        address.setS_address(cursor.getString(cursor.getColumnIndexOrThrow("s_address")));

        return address;
    }

}
